<%--
	注意：此页面为页面发起流程的公共引入页面
	1.引入的父页面需要注意contentType等属性配置
	2.页面中必要两个元素processDefinitionKey（流程编码）与taskDefinitionKey（首环节编码）——均参考流程定义文件即可
	3.业务页面均需要实现方法JavaScript方法modal_start()调用java代码发起流程
	4.showStartPanel()用于弹出环节及人员选择窗口
	5.提交成功后如需要，modal_start()可获取页面元素（link环节、assignee下环节处理人）以用于流程发布
	6.closeModal()用于关闭页面弹出窗口，需要时在流程发起后的回调函数中使用
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>流程发起待办页面-各流程发起嵌入页面</title>
	<script src="${pageContext.request.contextPath}/resource/js/frm/workflow/startpanel/process-start.js"></script>
</head>
<body>
	<!-- java代码请求应用根路径，供脚本文件使用 -->
	<input type="hidden" id="root" name="root" value="${pageContext.request.contextPath}/frm" />
	
	<!-- Button trigger modal -->
	<button type="button" id="showPanel" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myProcessStartModal" style="display:none;">
		Launch demo modal
	</button>

	<!-- Modal -->
	<div class="modal fade" id="myProcessStartModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				</div>
				<div class="modal-body">
			      	<div>
				      	<div class="col-sm-2">
				      		<label for="link" style="text-align:center;">下一环节名称</label>
				      	</div>
				      	<div class="col-sm-10" style="padding-bottom:20px;">
				      		<select class="form-control" id="link" name="link" onchange="clearAssignee();"></select>
				      	</div>
				      	<div class="clearfix"></div>
			      	</div>
			      	<div>
				      	<div class="col-sm-2">
				      		<label for="assignee" style="text-align:center;">下环节处理人</label>
				      	</div>
				      	<!-- <div class="col-sm-10" style="padding-bottom:20px;">
				      		<select class="form-control" id="assignee" name="assignee">
				      		</select>
				      	</div> -->
				      	<div class="col-sm-10" style="padding-bottom:20px;">
				      		<input type="text" name="assigneeName" class="form-control" id="assigneeName" readonly="readonly" style="padding-left:10px"/>
				      		<input type="hidden" name="assignee" class="form-control" id="assignee"/>
				      		<span style="font-size:16px; position:absolute;top:9px;right:25px;z-index:999;cursor:pointer;" class="glyphicon glyphicon-zoom-in" onclick="selectAssignee($('#link').val().split(',')[2]);"></span>
				      	</div>
				      	<div class="clearfix"></div>
			      	</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-success" onclick="startProcess($('#processDefinitionKey').val(), $('#assignee').val(), $('#link').val().split(',')[0]);">提交</button>
					<button type="button" id="closeModal" class="btn btn-default" data-dismiss="modal">返回</button>
				</div>
			</div>
		</div>
	</div>
</body>
</html>